package com.twu.biblioteca;

import com.twu.biblioteca.Entity.User;
import com.twu.biblioteca.Model.UserList;

public class UserAccountViewService implements Service{
    private UserList userList;

    public UserAccountViewService(UserList userList) {
        this.userList = userList;
    }

    @Override
    public String getServiceDescription() {
        return "View User Account";
    }

    @Override
    public Menu getMenu() {
        return null;
    }

    @Override
    public void doService() {
        User loginUser = userList.getLoginUser();
        if(loginUser !=null){
            System.out.println("Name:"+ loginUser.getName() +"\nEMail:"
                    + loginUser.getEmail() + "\nPhoneNumber:" + loginUser.getPhoneNumber() + "\n");
        }
        else{
            LoginService loginService = new LoginService(userList);
            loginService.doService();
        }
    }
}
